//
//  HSYCustomPhotoViewController+ALAsset.m
//  高仿暴走斗图
//
//  Created by key on 16/6/3.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "HSYCustomPhotoViewController+ALAsset.h"
#import "HSYCustomPhotoViewController+RACSignal.h"
#import "HSYBaseCardNavigationController.h"

@implementation HSYCustomPhotoViewController (ALAsset)

+ (void)rac_openAssetPhotoResourcesLibraryWithAssetType:(kALAssetType)type presentBlock:(void(^)(HSYBaseCardNavigationController *nav))block completion:(void(^)(id x))completion {

    HSYCustomPhotoViewController *vc = [[HSYCustomPhotoViewController alloc] initWithALAssetType:type];
    HSYBaseCardNavigationController *nav = [[HSYBaseCardNavigationController alloc] initWithRootViewController:vc];
    block(nav);
    [[[vc rac_didSelectCompletion] deliverOn:[RACScheduler mainThreadScheduler]] subscribeNext:^(id x) {
        completion(x);
    }];
}

@end
